#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <stdbool.h>

int main(void) {
	const char suits[] = { 'D', 'C', 'H', 'S' };
	const char ranks[] = { '2', '3','4', '5','6','7','8','9','T','J','Q','K','A' };
	bool in_hand[4][13] = { false };

	int cards;
	printf("Enter number of cards in hand: ");
	scanf("%d", &cards);

	srand(time(NULL));
	printf("Your hand: ");
	while (cards) {
		int s = rand() % 4;
		int r = rand() % 13;
		if (!in_hand[s][r]) {
			printf("%c%c ", ranks[r], suits[s]);
			cards--;
			in_hand[s][r] = true;
		}
	}
	printf("\n");
	return 0;
}